{% extends 'layout.html' %}
{% block content %}

<div class="container">
    <div style="margin-bottom:10px">
        <a class="btn btn-success" href="/admin/add_ModelForm/">
            <span class="glyphicon glyphicon-user" aria-hidden="true"></span>
            新建管理员（ModelForm组件方式）
        </a>
        <div style="float: right;width: 300px;">
            <form>
                <div class="input-group">
                    <input type="text" name="searchMobile" class="form-control" placeholder="关键字..."
                           value="{{ search_data }}">
                    <span class="input-group-btn">
                    <button class="btn btn-default" type="submit">
                        <span class="glyphicon glyphicon-search" aria-hidden="true"></span>
                    </button>
                </span>
                </div>
            </form>
        </div>
    </div>

    <div class="panel panel-default">
        <!-- Default panel contents -->
        <div class="panel-heading">
            <span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>
            管理员列表
        </div>

        <!-- Table -->
        <table class="table table-bordered">
            <thead>
            <tr>
                <th>ID</th>
                <th>姓名</th>
                <th>密码</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            {% for item in queryset%}
            <tr>
                <th>{{ item.id }}</th>
                <td>{{ item.username }}</td>
                <td>{{ item.password }}</td>
                <td>
                    <a class="btn btn-primary btn-xs" href="/admin/{{ item.id }}/edit/">修改</a>
                    <a class="btn btn-danger btn-xs" href="/admin/{{ item.id }}/delete/">删除</a>
                    <a class="btn btn-danger btn-xs" href="/admin/{{ item.id }}/reset_password/">重置密码</a>
                </td>
            </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
    <ul class="pagination">
        {{ page_nav }}
    </ul>

</div>

{% endblock %}
